package com.kira.scaffoldmvc.mmtest;

public class Singleton {

    public volatile Singleton instance = null;

    public synchronized Singleton getInstance(){
        if(instance == null){
            synchronized (instance){
                if(instance == null){
                    instance = new Singleton();
                    return instance;
                }
            }
        }
        return instance;
    }

    public void test() {
        Singleton myinstance = getInstance();
    }

}
